package com.ebupt.migu.music.autoTri.Mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.ebupt.migu.music.autoTri.Entity.VipPacketInfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @description: 会员红包模板管理
 * @author: liuyangyang@ebupt.com
 * @date: 2021/6/21 16:05
 */
@Mapper
@DS("mysql_mg")
public interface VipPacketMapper {

    /**
     * 创建会员红包
     *
     * @param params
     */
    public void add(Map<String, Object> params);

    /**
     * 更新红包信息
     */
    public void update(VipPacketInfo vipPacketInfo);

    /**
     * 查询红包列表
     *
     * @param params
     * @return
     */
    public List<Map<String, Object>> query(Map<String, Object> params);

    /**
     * 查询会员红包总数
     * @param params
     * @return
     */
    public Integer totalPackets(Map<String, Object> params);

    /**
     * 是否已经存在相同红包
     * @param actionId
     * @return
     */
    public boolean isActionIdExist(String actionId);

    /**
     * 通过ID查询红包详情
     * @param map
     * @return
     */
    public Map<String, Object> queryById(Map<String, Object> map);

    /**
     * 当前红包是否已经被策略引用
     * @param actionId
     * @return
     */
    boolean isVipPacketUsed(String actionId);
}
